#include <stdio.h>
 int main()
 { 
    int icase,n,i,j,a,sum;
    scanf("%d",&icase);
    for(i=0;i<icase;i++)
  {
    sum=0;
         scanf("%d",&n);
    for(j=0;j<n;j++)
    {
         scanf("%d",&a);
               sum+=a;
    }
    if(i<icase-1)
          printf("%d\n\n",sum);
         else
        printf("%d\n",sum);
 }
 } 
